Skip to content

feat: add copyright check functionality#21

Open
qxp930712 wants to merge 1 commit intozccrs:masterfrom
qxp930712:master
Open

feat: add copyright check functionality#21
qxp930712 wants to merge 1 commit intozccrs:masterfrom
qxp930712:master

Conversation

@qxp930712
Copy link

Added copyright check module that automatically verifies copyright and license headers in staged files during commit process. The system checks for copyright notices, validates copyright years, and ensures license declarations are present. For new files, it examines staged content while for modified files it checks working directory content. Users are prompted to confirm continuation if copyright issues are detected.

The implementation includes file type detection, content extraction from git staging area, and comprehensive copyright pattern matching. Uses chrono crate for current year comparison to ensure copyright dates are up-to-date.

Log: Added automated copyright checking during commit process

Influence:

  1. Test copyright check with files containing valid copyright headers
  2. Verify detection of missing copyright notices in new files
  3. Test copyright year validation with outdated years
  4. Check license declaration detection for various license types
  5. Verify user prompt behavior when copyright issues are found
  6. Test skip functionality when using amend mode
  7. Validate file type detection for different file extensions
  8. Test content extraction from both staged and working directory files

@qxp930712 qxp930712 force-pushed the master branch 2 times, most recently from 600e9ec to 7e908d2 Compare March 14, 2026 07:23
Added copyright check module that automatically verifies copyright and
license headers in staged files during commit process. The system checks
for copyright notices, validates copyright years, and ensures license
declarations are present. For new files, it examines staged content
while for modified files it checks working directory content. Users are
prompted to confirm continuation if copyright issues are detected.

The implementation includes file type detection, content extraction from
git staging area, and comprehensive copyright pattern matching. Uses
chrono crate for current year comparison to ensure copyright dates are
up-to-date.

Log: Added automated copyright checking during commit process

Influence:
1. Test copyright check with files containing valid copyright headers
2. Verify detection of missing copyright notices in new files
3. Test copyright year validation with outdated years
4. Check license declaration detection for various license types
5. Verify user prompt behavior when copyright issues are found
6. Test skip functionality when using amend mode
7. Validate file type detection for different file extensions
8. Test content extraction from both staged and working directory files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants